# -*- coding: utf-8 -*-
# @Time     : 2021/12/1 13:57
# @Author   : wljess
# @File     : 创建多个线程.py
# @Describe : 
# @Software : PyCharm


import time
from threading import Thread


def task(num):
    print(f"i am son{num} thread...")
    time.sleep(0.5)
    print(f"son thread{num} ending...")


if __name__ == '__main__':
    lst_t = []
    for i in range(10):
        t = Thread(target=task, args=(i, ))
        t.start()
        lst_t.append(t)

    for th in lst_t:
        th.join()  # 阻塞，直到子线程执行结束，再执行
    print("主线程结束...")
